package com.kun.video.ui.pane;

import com.kun.video.ui.KunComponent;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.layout.HBox;

/**
 * 自定义水平容器
 *
 * <h2>设计目标</h2>
 * 1. 性能优化：通过事件节流降低高频操作时的CPU占用<br>
 * 2. 扩展性：提供可重写的生命周期方法和事件回调<br>
 * 3. 资源管理：自动清理无效监听器，避免内存泄漏<br>
 *
 * @author gzc
 */
public class KunHorBox extends HBox implements KunComponent {
    private static final String CSS_CLASS = "kun-hor-box";

    public KunHorBox() {
        this(0);
    }

    public KunHorBox(double spacing) {
        super(spacing);
        KunComponent.super.initialize();
    }

    public KunHorBox(Node... nodes) {
        super(nodes);
        KunComponent.super.initialize();
    }

    @Override
    public Parent getNode() {
        return this;
    }

    @Override
    public String getStyleName() {
        return CSS_CLASS;
    }

    @Override
    public void initStyleClass() {
        // 内联CSS变量定义
        String inlineCss = "";
        setStyle(inlineCss);
        KunComponent.super.initStyleClass();
    }

    @Override
    public void initLayout() {

    }

    @Override
    public void initStyle() {

    }

    @Override
    public void initDimensions() {

    }

    @Override
    public void reactiveDimensions(double width, double height) {

    }

    @Override
    public void initData() {

    }

    @Override
    public void initListeners() {
    }

    @Override
    public void dispose() {
        // 清理属性
        getProperties().clear();
    }

}
